<!--11.5 Redesigned post sub-template-->
<table class="table table-hover">
        <tr>
            <td width="70px">
                <a href="{{ url_for('user', username=post.author.username) }}">
                    <img src="{{ post.author.avatar(70) }}" />
                </a>
            </td>
            <td>
{#                <a href="{{ url_for('user', username=post.author.username) }}">#}
{#                    {{ post.author.username }}#}
{#                </a>#}
{#                said: {{ moment(post.timestamp).fromNow() }}#}
{#13.3  create an intermediate variable called user_link using the set and endset template directives, and then pass that as an argument to the translation function.#}
        {% set user_link %}
            <a href="{{ url_for('user', username=post.author.username) }}">
                {{ post.author.username }}
            </a>
        {% endset %}
        {{ _('%(username)s said %(when)s',
            username=user_link, when=moment(post.timestamp).fromNow()) }}
                <br>
{#14.3 add a translate link            #}
                <span id="post{{ post.id }}">{{ post.body }}</span>
                {% if post.language and post.language != g.locale %}
                <br><br>
                 <span id="translation{{ post.id }}">
                <a href="javascript:translate('#post{{ post.id }}', '#translation{{ post.id }}', '{{ post.language }}', '{{ g.locale }}');">{{ _('Translate') }}</a> # 14.7 调用，中联所有的关键
                 </span>
                {% endif %}
            </td>
        </tr>
    </table>